<?php
/**
 * @Author:      zhaoyang
 * @DateTime:    2018-1-30 
 * @Description: PMS 采购单
 */
class PMSOrderProducts extends Eloquent
{
    protected $table = "pms_order_products";
    protected $primaryKey = "id";
    
    //创建人
    public function created_by(){
        return $this->belongsTo('PMSUser','created_by','id');
    }

    //查询采购单下的商品
    public static function pms_products($pms_code){
        return PMSOrderProducts::where("pms_code",$pms_code)->where("status",1)->get();
    }
}